home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ASTRONOM / H139.ZIP / UI101.ZIP / IO / UI / UI_TW.C < prev    next >
C/C++ Source or Header  |  1991-11-04  |  3KB  |  89 lines

  1. /****************************************************************
  2.  
  3.     ui_tw.c         Text Window Box under UI
  4.             The Bywater Graphical User Interface
  5.  
  6.             Copyright (c) 1991, Ted A. Campbell
  7.  
  8.             Bywater Software
  9.             P. O. Box 4023
  10.             Duke Station
  11.             Durham, NC  27706
  12.  
  13.             email: tcamp@hercules.acpub.duke.edu
  14.  
  15.     Copyright and Permissions Information:
  16.  
  17.     All U.S. and international copyrights are claimed by the
  18.     author. The author grants permission to use this code
  19.     and software based on it under the following conditions:
  20.     (a) in general, the code and software based upon it may be
  21.     used by individuals and by non-profit organizations; (b) it
  22.     may also be utilized by governmental agencies in any country,
  23.     with the exception of military agencies; (c) the code and/or
  24.     software based upon it may not be sold for a profit without
  25.     an explicit and specific permission from the author, except
  26.     that a minimal fee may be charged for media on which it is
  27.     copied, and for copying and handling; (d) the code must be
  28.     distributed in the form in which it has been released by the
  29.     author; and (e) the code and software based upon it may not
  30.     be used for illegal activities.
  31.  
  32. ****************************************************************/
  33.  
  34. #include "stdio.h"
  35. #include "bw.h"
  36. #include "gr.h"
  37. #include "tw.h"
  38. #include "ui.h"
  39.  
  40. #ifdef  __STDC__
  41. #include "malloc.h"
  42. #else
  43. extern  char * malloc();
  44. #endif
  45.  
  46. struct ui_twstruct *
  47. ui_twinit( title, rq_x1, rq_y2, rq_lines, rq_cols,
  48.        min_x1, min_y1, max_x2, max_y2 )
  49.    char *title;                 /* ttle for window */
  50.    int rq_x1;                   /* requested x1 (left, graphics) position */
  51.    int rq_y2;                   /* requested y2 (top,  graphics) position */
  52.    int rq_lines;                /* requested text lines */
  53.    int rq_cols;                 /* requested text columns */
  54.    int min_x1;                  /* leftmost   allowable position */
  55.    int min_y1;                  /* bottommost allowable position */
  56.    int max_x2;                  /* rightmost  allowable position */
  57.    int max_y2;                  /* topmost    allowable position */
  58.    {
  59.    static struct tw_struct *tw;
  60.    static struct ui_twstruct uitw;
  61.    static struct uiwindow *uiwind;
  62.  
  63.    tw = tw_init( rq_x1 + 6, rq_y2 - ( ui_grwind->fysize + 8 ),
  64.          rq_lines, rq_cols,
  65.          min_x1, min_y1, max_x2, max_y2 );
  66.  
  67. #ifdef OLD_DEBUG
  68.    sprintf( bw_ebuf, "ui_twinit(): request box: x1 %d y1 %d x2 %d y1 %d",
  69.       tw->x1 - 3, tw->y1 - 3, tw->x2 + 3,
  70.       tw->y2 + ui_grwind->fysize + 2 );
  71.    bw_debug( bw_ebuf );
  72. #endif
  73.  
  74.    uiwind = ui_window( tw->x1 - 6, tw->y1 - 8, tw->x2 + 8,
  75.       tw->y2 + ui_grwind->fysize + 8, TRUE, WHITE, BLACK,
  76.       title,
  77.       TRUE, WHITE, TRUE, BLACK, BLACK, SOLID, BUT_CLOSE | BUT_MOVE | BUT_RESIZE  );
  78.  
  79.    uitw.tw = tw;
  80.    uitw.uiw = uiwind;
  81.  
  82.    return &uitw;
  83.  
  84.    }
  85.  
  86. ui_twdeinit()
  87.    {
  88.    }
  89.